/*
 * GIPF; Team 2, Maastricht University; Project 2-1, Fall 2012.
 */
package gipf.trunk;

import java.util.ArrayList;

/**
 *
 * @author log:
 */
public class RuleBook implements Rules{
    
    int turnCount;
    Action lastAction;
    ArrayList<Action> actionList;
    
    
    public RuleBook(){
        turnCount = 0;
        this.actionList = new ArrayList<Action>();
    }
    
    
    @Override
    public void perform(){
        //System.out.println("TURNS performed" + this.turnCount);

        this.turnCount++;
        
//    	String command = lastAction.command.extractHead();
//    	switch(command){
//    	case "move": ; break;
//    	case "take": this.turnCount++; break;
//    	case "place": break;
//    	default: break;
//    	}
    };
    
    public int getTurn(){
        return this.turnCount;
    }
   

     public void setAction(Action a){
        this.actionList.add(a);
     }
     
     public Action getAction(){
        Action a = this.actionList.get(0);
        lastAction = a;
        this.actionList.clear();
        return a;
        
     }
     
     public boolean isActionListEmpty(){
         if(this.actionList.isEmpty())
             return true;
         else 
             return false;
     
     }


	@Override
	public boolean isValid(Command cmd) {
		// TODO Auto-generated method stub
		return false;
	}
     
//     public Action returnAction(){
//         return this.newAction;
//     
//     }
        
        
        
        
}
